from django.db import models


class BuddhaWords(models.Model):
    class Meta:
        verbose_name = '词条'

    name = models.CharField(max_length=100, verbose_name='词条名称', default=0)
    description = models.TextField(verbose_name='词条描述', default=0)
    analysis = models.TextField(help_text='讲解', default=0)
    photo = models.FileField(verbose_name="图片", null=True)

    def __str__(self):
        return 'name:'+self.name+';description:'+self.description + \
               'analysis:'+self.analysis+';photo:'+str(self.photo)


class BuddhaNav(models.Model):
    class Meta:
        verbose_name = "导航栏"
        pass

    sequence = models.IntegerField(default=0)
    name = models.CharField(verbose_name="导航名称", max_length=100, blank=True, default="")
    link = models.CharField(max_length=100, default="")


class LastSearch(models.Model):
    class Meta:
        verbose_name = "最近搜索"
        pass

    sequence = models.IntegerField(default=0)
    name = models.CharField(verbose_name="关键词名称", max_length=100, blank=True, default="")


class SystemConfig(models.Model):
    class Meta:
        verbose_name = "系统配置"
        pass

    logo = models.CharField(max_length=100)
    name = models.CharField(max_length=100)


class FriendLink(models.Model):
    class Meta:
        verbose_name = "友情链接"
        pass

    sequence = models.IntegerField(default=0)
    name = models.CharField(verbose_name="链接名称", max_length=100, blank=True, default="")
    link = models.CharField(max_length=100, blank=True, default="")
